home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_03_shs_cinematic_2_orig.cog < prev    next >
Text File  |  1999-11-15  |  41KB  |  1,463 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 03_SHS_Cinematic_2.cog
  4. #
  5. # Indy encounters the Holy Woman
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15. # **************************** MESSAGES *****************************
  16.  
  17.     message        startup
  18.     message        entered
  19.     message        activated
  20.     message        callback
  21.     message        pulse
  22.     message        user0
  23.     message        user1
  24.     message        user2
  25.  
  26. # **************************** KEYFRAMES ****************************
  27.     
  28.     keyframe    in_pushHat=0in_figithat_4_4.key            local
  29.     keyframe    in_rtarmup=0in_armsout_1_1.key            local
  30.     keyframe    in_botharmsup=0in_armsup_1_1.key        local
  31.     keyframe    in_Think=0in_thinking_4_4.key            local
  32.     keyframe    in_ltarmup=0in_leftarm_1_1.key            local
  33.     
  34.     keyframe    in_handsSide=0in_stand1.key                local
  35.     keyframe    in_armsCrossed=0in_stand2.key            local
  36.     keyframe    in_handsOnHips=0in_stand4.key            local
  37.     keyframe    in_crossArms=0in_stand1_bd_2.key           local
  38.     keyframe    in_handsToHips=0in_stand1_bd_4.key           local
  39.     keyframe    in_handsToSide=0in_stand4_bd_1.key           local
  40.     
  41.     keyframe    in_plantready=0in_pull_bulb_1_14.key    local
  42.     keyframe    in_giveplant=0in_giveobj_14_1.key        local
  43.     keyframe    in_wow=0in_reaction.key                    local
  44.     keyframe    in_takekey=0in_takeobj_1_1.key            local
  45.  
  46.  
  47.     keyframe    in_pull=in_pull_lever_down.key            local
  48.     keyframe    lever_down=gen_lever.key                local
  49.     
  50.     keyframe    br_fwd=0ri_roll_fwd.key                    local
  51.     keyframe    br_back=0ri_roll_back.key                local
  52.     
  53.     keyframe    ol_confused=0ol_lookaround_5_1.key        local
  54.     keyframe    ol_basicstand=ol_stand.key                local
  55.     keyframe    ol_altbasicstand=0ol_stand1_nohead.key    local
  56.     keyframe    ol_put2honcane=0ol_wavecane_1_2.key        local
  57.     keyframe    ol_stand2honcane=0ol_stand2_nohead.key    local
  58.     keyframe    ol_standwkey=0ol_stand3_nohead.key        local
  59.     keyframe    ol_nod=0ol_nod_2_2.key                    local
  60.     keyframe    ol_ltwave=0ol_lefthnd_2_2.key            local
  61.     keyframe    ol_takeplantA=0ol_getobj_2_parta.key    local
  62.     keyframe    ol_takeplantB=0ol_getobj_partb_4.key    local
  63.     keyframe    ol_showkey=0ol_holdupkey_1_3.key        local
  64.     keyframe    ol_givekey=0ol_handkey_3_2.key            local
  65.     keyframe    ol_pointcane=0ol_pointcane_1_2.key        local
  66.     keyframe    ol_wavecane2=0ol_righthnd_2_1.key        local
  67.     keyframe    ol_lookatbud=0ol_stand4.key                local
  68.     
  69.     keyframe    yl_bentover=0yl_stand4.key                local
  70.     keyframe    yl_transform=0yl_transform_4_2.key        local
  71.     keyframe    yl_upright=0yl_stand2.key                local
  72.     keyframe    yl_losecane=0yl_throwcane_2_3.key        local
  73.     keyframe    yl_standwf=0yl_stand3.key                local
  74.     keyframe    yl_standnof=0yl_stand1.key                local
  75.     keyframe    yl_putflower=0yl_placepot_3_1.key        local
  76.     keyframe    yl_throwbar=0yl_pushbar_1_1.key            local
  77.     keyframe    yl_opendoors=0yl_opendoors_1_1.key        local
  78.     keyframe    yl_icedanger=0yl_righthnd_1_1.key        local
  79.     keyframe    yl_rthandup=0yl_righthnd_1_1.key        local
  80.     keyframe    yl_lthandup=0yl_left_1_1.key            local # currently rthand (!)
  81.     keyframe    yl_armspointway=0yl_armsout_1_1.key        local
  82.     keyframe    yl_armsup=0yl_armsup_1_1.key            local
  83.  
  84.     keyframe    plant_wait=shs_flower_stand.key            local
  85.     keyframe    plant_bloom=shs_flower_bloom.key        local
  86.     keyframe    cane_fly=0yl_cane_throwcane.key            local
  87.     
  88.     keyframe    bar_flip=shs_bar_lock.key                local
  89.     keyframe    ldr_open=shs_door_barl.key                local
  90.     keyframe    rdr_open=shs_door_barr.key                local
  91.     
  92. # ***************************** MODELS ******************************
  93.         
  94.     model          mod_in=gen_in.3do                        local
  95.     model        mod_in_hand_key=hand_in_olkey.3do        local
  96.     model          mod_in_hand_bud=hand_in_bud.3do            local
  97.     
  98.     model          mod_ol=shs_ol.3do                        local
  99.     model          mod_ol_hand_key=hand_ol_key.3do            local
  100.     model          mod_ol_hand_bud=hand_ol_bud.3do            local
  101.     
  102.     model          mod_yl=shs_yl.3do                        local
  103.     model          mod_yl_hand_cane=hand_yl_cane.3do        local
  104.     model          mod_yl_hand_bloom=hand_yl_bloom.3do        local
  105.             
  106. # ***************************** SOUNDS ******************************
  107.     
  108.     sound        ol_rang=Ss05w01.wav                        local
  109.     sound        in_thatsright=Ss05j02.wav                local
  110.     sound        ol_wanthelp=Ss05w03.wav                    local
  111.     sound        in_lost=Ss05j04.wav                        local
  112.     sound        ol_youhelpme=Ss05w05.wav                local
  113.     sound        in_showmeway=Ss05j06.wav                local
  114.     sound        ol_goldtreasure=Ss05w07.wav                local
  115.     sound        in_whereisit=Ss05j08.wav                local
  116.     sound        ol_treasury=Ss05w09a.wav                local
  117.     sound        ol_takekey=Ss05w09b.wav                    local
  118.     sound        ol_hello2=Ss05w10.wav                    local
  119.     sound        in_notfoundyet=Ss05j11.wav                local
  120.     sound        ol_looktreasury=Ss05w12.wav                local
  121.     sound        ol_hello3=Ss05w13.wav                    local
  122.     sound        in_foundbulbA=Ss05j14a.wav                local
  123.     sound        in_foundbulbB=Ss05j14b.wav                local
  124.     sound        ol_mustbecome=Ss05w15.wav                local
  125.     sound        ol_snort=Ss05w07a.wav                    local
  126.  
  127.     sound        ol_gottreasure=Ss09w01.wav                local
  128.     sound        in_bestdo=Ss09j02.wav                    local
  129.     sound        ol_notyet=Ss09w03.wav                    local
  130.     
  131.     sound        yl_greatgift=Ss09y04.wav                local
  132.     sound        yl_waytocurse=Ss09y05.wav                local
  133.     sound        yl_bewareice=Ss09y06.wav                local
  134.  
  135.     sound        in_nowork=Inxj092.wav                    local
  136.     sound        in_notgoodenough=Inxj093.wav            local
  137.     sound        in_hmm=inxj269.wav                        local
  138.  
  139.     sound        leverpull=nub_lever_pull_c.wav            local
  140.     sound        leverback=nub_lever_reset_c.wav            local
  141.  
  142.     sound        in_doorlocked=Inxj101.wav                local
  143.     sound        in_notopen=Inxj096.wav                    local
  144.     
  145. # ***************************** THINGS ******************************
  146.  
  147.     thing        player                                    local
  148.     
  149.     thing        indy                                     linkid=0
  150.     thing        bellringer
  151.     thing        oldlady
  152.     thing        younglady
  153.     thing       lever
  154.     thing        barlock
  155.     
  156.     thing        plant                                    nolink
  157.     thing        static_flower                            nolink
  158.     thing        flyingcane                                nolink
  159.  
  160.     thing        leftdoor                                nolink
  161.     thing        rightdoor                                nolink
  162.     thing        barup                                    nolink
  163.     thing        ldooropen                                nolink
  164.     thing        rdooropen                                nolink
  165.                                             
  166.     thing        cam_1                                    nolink
  167.     thing        cam_2                                    nolink
  168.     thing        cam_3                                    nolink
  169.     thing        cam_4                                    nolink
  170.     thing        cam_5                                    nolink
  171.     thing        cam_6                                    nolink
  172.     thing        cam_7                                    nolink
  173.     thing        cam_8                                    nolink
  174.     thing        cam_9                                    nolink
  175.     thing        cam_10                                    nolink
  176.     thing        cam_11                                    nolink
  177.     thing        cam_12                                    nolink
  178.     thing        cam_13                                    nolink
  179.     
  180.     thing        c_t1                                    nolink
  181.     thing        c_t2                                    nolink
  182.     thing        c_t3                                     nolink
  183.     thing        c_t4                                    nolink
  184.     thing        c_t5                                    nolink
  185.     thing        c_t6                                    nolink
  186.     thing        c_t7                                    nolink
  187.     thing        c_t8                                    nolink
  188.     thing        c_t9                                    nolink
  189.     thing        c_t10                                    nolink
  190.     thing        c_t11                                    nolink
  191.     thing        c_t12                                    nolink
  192.     thing        c_t13                                    nolink
  193.     thing        c_t14                                    nolink
  194.     thing        c_t15                                    nolink
  195.     
  196.     thing        c_t2_br                                    local # created in cog
  197.     
  198.     thing        ol_mk1                                    nolink
  199.     thing        ol_plantspot                            nolink
  200.  
  201.     thing        yl_mk1                                    nolink
  202.     thing        yl_mk2                                    nolink
  203.     thing        yl_mk3                                    nolink
  204.     thing        yl_mk4                                    nolink
  205.     thing        yl_mk5                                    nolink
  206.     
  207.     thing        in_mk2                                  nolink
  208.     thing        in_mk3                                    nolink
  209.     thing        in_mk4                                    nolink
  210.     thing        in_mk5                                    nolink
  211.     thing        in_mk6                                    nolink
  212.     thing        in_mk7                                    nolink
  213.  
  214.     thing        br_mk1                                    nolink
  215.     thing        br_mk2                                    nolink
  216.  
  217.     thing        headLookThing                            local # var
  218.     thing        camPosThing                                local # var
  219.  
  220. # ************************ ENGINE WEIRDNESS *************************
  221.  
  222.     cog            ringercog
  223.     cog            bellcog
  224.             
  225.     sector        trigger
  226.  
  227.     template    ghost_tpl=ghost                            local
  228.     
  229. # **************************** VARIABLES ****************************
  230.     
  231.     vector        camPos                                    local
  232.     vector        interpCamPos                            local
  233.     vector        interpCamLook                            local
  234.     vector        indyHeadAim                                local
  235.     vector        debugVector                                local
  236.  
  237.     vector        ladyPosVec                                local
  238.     vector        indyPosVec                                local
  239.     vector        indyAimVec                                local
  240.     vector        indyNormVec                                local
  241.     
  242.     flex        oldladyCollSize                            local
  243.     flex        oldladyMass                                local
  244.     flex        ol_rotRate                                local
  245.     flex        in_rotRate                                local
  246.     flex        movespeed=1.0                            local
  247.     flex        indyTrackRate=0.05                        local
  248.  
  249.     flex        tempVX                                    local
  250.     flex        tempVY                                    local
  251.     flex        tempflex                                local
  252.                             
  253.     int            cutSceneState=0                            local
  254.     int            leverState=0                            local
  255.     int            ringerState=0                            local
  256.     int         ringerready=0                            local
  257.     int            bellready=0                                local
  258.     int            bellRangAlready=0                        local
  259.     int            belltop=0                                local
  260.     int            plantState=0                            local
  261.     int            doorchat=0                                local
  262.     int            olNowAtSpot=0                            local
  263.  
  264.     int            in_keyTrack1                            local
  265.     int            in_keyTrack2                            local
  266.     int            br_keyTrack1                            local
  267.     int            ol_keyTrack1                            local
  268.     int            yl_keyTrack1                            local
  269.     int            plt_keyTrack1                            local
  270.     int            can_keyTrack1                            local
  271.     int            bar_keyTrack1                            local
  272.     int            ldr_keytrack1                            local
  273.     int            rdr_keyTrack1                            local
  274.         
  275.     int            sender                                    local
  276.     int            curSound                                local
  277.     int            curCam                                    local
  278.     int            swapper                                    local
  279.     
  280.     int            in_swapCase=0                            local
  281.     int            ol_swapCase=0                            local
  282.     int            yl_swapCase=0                            local
  283.                         
  284.     int            oldladyCollType                            local
  285.     
  286.     int            sealkey=87                                local # inventory bin
  287.     int            plantbulb=104                            local # inventory bin
  288.     int            plantleaf=105                            local # inventory bin
  289.     int            plantbud=106                            local # inventory bin
  290.     
  291.     int            noRollComment                            local
  292.     int            noRingComment                            local
  293.  
  294. end
  295.  
  296. # ===================================================================
  297.  
  298. code
  299.  
  300. # ...................................................................
  301.  
  302. startup:
  303.  
  304.     # Pointer to Player...
  305.     player = GetLocalPlayerThing();
  306.  
  307.     # Prep Old Holy Woman...
  308.     SetThingFlags(oldlady, 0x80000);
  309.     oldladyCollSize = GetThingCollideSize(oldlady);
  310.     oldladyCollType = GetCollideType(oldlady);
  311.     oldladyMass = GetThingMass(oldlady);
  312.     ol_rotRate = GetThingMaxRotVel(oldlady);
  313.     AISetMode(oldlady, 0x2000); # turn off her AI
  314.  
  315.     # Prep Young Holy Woman...
  316.     SetThingFlags(younglady, 0x80000);
  317.     AISetMode(younglady, 0x2000); # turn off her AI
  318.  
  319.     # Hide the many objects...
  320.     SetThingFlags(plant, 0x80000);
  321.     SetThingFlags(static_flower, 0x80000);
  322.     SetThingFlags(flyingcane, 0x80000);
  323.     SetThingFlags(barup, 0x80000);
  324.     SetThingFlags(ldooropen, 0x80000);
  325.     SetThingFlags(rdooropen, 0x80000);
  326.  
  327.     return;
  328.  
  329. # -------------------------------------------------------------------
  330.  
  331. entered:
  332.  
  333.     # NOTE:  use this with a trigger to pop the old lady to a nice convenient spot
  334.     # near the flower stand when Indy returns...
  335.     
  336.     # TO DO:  find a reliable trigger sector
  337.  
  338.     if (bellRangAlready == 1 && olNowAtSpot == 0)
  339.     {
  340.         olNowAtSpot = 1;
  341.         TeleportThing(oldlady, ol_plantspot);
  342.     }
  343.     return;
  344.  
  345. # ...................................................................
  346.  
  347. user0:
  348.  
  349.     # NOTE: Sent by whatever attached cogs know the overall readiness 
  350.     # states of the bellringer and the bell to signify NOT READY...
  351.  
  352.     if (GetSenderRef() == ringercog)
  353.     {
  354.         ringerready = 0; # bellringer cannot perform its duties
  355.     }
  356.  
  357.     if (GetSenderRef() == bellcog)
  358.     {
  359.         bellready = 0; # bell is not in position
  360.     }
  361.  
  362.     return;
  363.  
  364. # ...................................................................
  365.  
  366. user1:
  367.  
  368.     # NOTE: Sent by whatever attached cogs know the overall readiness 
  369.     # states of the bellringer and the bell to signify READY FOR ACTION...
  370.  
  371.     if (GetSenderRef() == ringercog)
  372.     {
  373.         ringerready = 1; # bellringer can ring
  374.     }
  375.  
  376.     if (GetSenderRef() == bellcog)
  377.     {
  378.         bellready = 1; # bell is in position
  379.     }
  380.  
  381.     return;
  382.  
  383. # ...................................................................
  384.  
  385. user2:
  386.  
  387.     # NOTE: Sent by attached bellcog when bell reaches top of tower...
  388.     # (currently, this cog pays no attention)
  389.  
  390.     if (GetSenderRef() == bellcog)
  391.     {
  392.         belltop = 1; # bell is all the way up
  393.     }
  394.  
  395.     return;
  396.  
  397. # ...................................................................
  398.  
  399. activated:
  400.  
  401.     sender = GetSenderRef();
  402.     
  403.     if (sender == lever && leverState == 0)
  404.     {
  405.         # Indy must ring the bell to meet the old lady...
  406.     
  407.         # Prep for cutscene...
  408.         StartCutscene(1);
  409.         curCam = GetCurrentCamera();
  410.  
  411.         leverState = 1;
  412.  
  413.         # Mood music!
  414.         # PlaySong(5, 5, 5);
  415.  
  416.         ### temp develop stuff...
  417.         ringerready = 1;
  418.         ###
  419.         
  420.         # Prep indy...
  421.         in_rotRate = GetThingMaxRotVel(indy);
  422.         SetThingMaxRotVel(indy, 75.0);
  423.         TeleportThing(indy, in_mk2);
  424.         
  425.         # Disable player...
  426.         StopThing(player); # right now
  427.         PlayMode(player, 1, 0); # get him into a nice stand
  428.         DeselectWeapon(player); # stow any weapon or lighter
  429.         CopyPlayerHolsters(player, indy); # make sure our actor has matching props
  430.         Sleep(0.5); # give him some time to do his stuff
  431.         
  432.         # Switch actor indy for player...
  433.         SetThingFlags(player, 0x80000); # hide him
  434.         SetActorFlags(player, 0x200000); # paralyze him
  435.         ClearThingFlags(indy, 0x80000); # reveal our actor
  436.         
  437.         # Prep camera & cut...
  438.         SetCameraLookInterp(2, 0); # no pan & tilt
  439.         SetCameraPosInterp(2, 0); # no dolly
  440.         SetCameraFocus(2, cam_1);
  441.         SetCameraSecondaryFocus(2, c_t1);
  442.         SetCurrentCamera(2);
  443.         SetCameraFOV(55, 0, 0.0);
  444.         Sleep(0.01);
  445.  
  446.         PlayKey(lever, lever_down, 4, 0x12, 0);
  447.         PlayKey(indy, in_pull, 4, 0x12, 0);
  448.         Sleep(1.2);
  449.         PlaySoundLocal(leverpull, 1.0, 0, 0x0000, 0);
  450.         Sleep(1.4);
  451.         PlaySoundLocal(leverback, 1.0, 0, 0x0000, 0);
  452.         Sleep(0.3);
  453.  
  454.         if (ringerready == 1)
  455.         {
  456.             call rollringer; 
  457.  
  458.             if (bellready == 1 && bellRangAlready == 0)
  459.             {
  460.                 call ringbell;
  461.                 camPosThing = cam_8; # pos for interp back to follow cam
  462.                 call backtoplay;
  463.             }
  464.             else 
  465.             {
  466.                 call noring;
  467.                 camPosThing = c_t5;
  468.                 call backtoplay;
  469.             }
  470.         }
  471.         else
  472.         {
  473.             call noroll;
  474.             camPosThing = c_t5;
  475.             call backtoplay;
  476.         }    
  477.     }
  478.     else
  479.     {
  480.         if (sender == oldlady || sender == younglady)
  481.         {
  482.             # Talk to her...
  483.             call morechat;
  484.         }
  485.         else 
  486.         {
  487.             if (sender == barlock)
  488.             {
  489.                 # Notice the barred door...
  490.                 call doorbarred;
  491.             }
  492.         }
  493.     }
  494.  
  495.      return;
  496.      
  497. # ...................................................................
  498.  
  499. rollringer:
  500.  
  501.     # Prep bellringer shot...
  502.     ClearThingFlags(bellringer, 0x80000); # reveal bellringer
  503.     c_t2_br = CreateThing(ghost_tpl, c_t2); # dupe target & frame (see Marcus)
  504.     CaptureThing(c_t2_br);
  505.     AttachThingToThing(c_t2_br, bellringer); # glue it to bellringer
  506.  
  507.     # Start him twirling...
  508.     br_keyTrack1 = PlayKey(bellringer, br_fwd, 4, 0x10, 0);
  509.         
  510.     # Cut to bellringer...
  511.     SetCameraFocus(2, cam_2);
  512.     SetCameraSecondaryFocus(2, c_t2_br); # aim at new target near ringer
  513.     SetCameraFOV(60, 0, 0.0); # was 70
  514.     Sleep(0.01);
  515.     
  516.     # Move ringer...
  517.     AISetMoveSpeed(bellringer, 1.2);
  518.     AISetLookThing(bellringer, br_mk2);
  519.     AISetMoveThing(bellringer, br_mk2, 0);
  520.  
  521.     # Indy watches...
  522.     AISetLookThing(indy, cam_2);
  523.     headLookThing = bellringer;
  524.     SetPulse(indyTrackRate);
  525.     
  526.     # Boom & Zoom to tightly frame ringer...
  527.     MoveToFrame(c_t2_br, 1, 0.25);
  528.     Sleep(0.01);
  529.     SetCameraFOV(38, 1, 4.0);
  530.     Sleep(4.5);
  531.     
  532.     # Boom & Zoom back...
  533.     # TO DO:  find out why next MoveToFrame() screws up target attachment!
  534.     # MoveToFrame(c_t2_br, 0, 0.35);
  535.     SetCameraFOV(60, 1, 3.0);
  536.     
  537.     # Indy watches...
  538.     Sleep(3.5);
  539.     AISetLookThing(indy, in_mk7);
  540.  
  541.     # Bellringer continues to move into ring/noring code...
  542.     ringerState = 1;
  543.     
  544.     return;
  545.  
  546. # ...................................................................
  547.  
  548. ringbell:
  549.  
  550.     # This should happen just once...
  551.     bellRangAlready = 1;
  552.     
  553.     # Reposition Indy...
  554.     TeleportThing(indy, in_mk6);
  555.     Sleep(0.01);
  556.     AISetLookThing(indy, in_mk7);
  557.  
  558.     # Prep holy woman under the bell...
  559.     ClearThingFlags(oldlady, 0x80000);
  560.     SetThingMaxRotVel(oldlady, 10.0);
  561.     
  562.     # Cut inside tower...
  563.     SetCameraLookInterp(2, 0); # no pan & tilt
  564.     SetCameraFocus(2, cam_3);
  565.     SetCameraSecondaryFocus(2, bellringer);
  566.     SetCameraFOV(80, 0, 0.0);
  567.     Sleep(0.01);
  568.  
  569.     SetCameraLookInterp(2, 1); # allow pan & tilt
  570.     SetCameraInterpSpeed(2, 3.5); # was 3.5
  571.     Sleep(0.01);
  572.     SetCameraSecondaryFocus(2, c_t3);
  573.     SetCameraFOV(100, 1, 3.5); # was 3.5
  574.  
  575.     # Pose Indy...
  576.     Sleep(2.0);
  577.     SetPulse(0); # stop his head moving around
  578.     AISetLookThing(indy, oldlady);
  579.     
  580.     # Finish ringer move...
  581.     AIWaitForStop(bellringer);
  582.     Sleep(0.1);
  583.     StopKey(bellringer, br_keyTrack1, 0.0);
  584.  
  585.     # TO DO: drop in sound of ringer hitting bell
  586.  
  587.     Sleep(0.3);
  588.     DetachThing(c_t2_br);
  589.     DestroyThing(c_t2_br);
  590.     
  591.     # Now ringer retreats...
  592.     AISetMoveThing(bellringer, br_mk1, 0);
  593.     br_keyTrack1 = PlayKey(bellringer, br_back, 4, 0x10, 0);
  594.     Sleep(1.5);
  595.  
  596.     # Raise bell...
  597.     SendMessage(bellcog, user2);
  598.     
  599.     # Zoom in on Holy Woman...
  600.     SetCameraLookInterp(2, 0); # stop interping for a while
  601.     Sleep(0.01);
  602.     SetCameraSecondaryFocus(2, c_t4);
  603.     SetCameraFOV(40, 1, 6.0);
  604.     MoveToFrame(c_t4, 1, 0.24);
  605.     
  606.     # Reset bellringer...
  607.     StopKey(bellringer, br_keyTrack1, 0.0);
  608.     StopThing(bellringer);
  609.     TeleportThing(bellringer, br_mk1);
  610.     Sleep(0.1); # magic sleep that cures c_t2_br target placement on re-tries!
  611.     SetThingFlags(bellringer, 0x80000); # hide
  612.     ringerState = 0;
  613.     
  614.     # She seems confused...
  615.     ol_keyTrack1 = PlayKey(oldlady, ol_confused, 2, 0x12, 0);
  616.     Sleep(1.5);
  617.     
  618.     # Holy Woman turns toward Indy...
  619.     StopKey(oldlady, ol_keyTrack1, 0.5);
  620.     AISetLookThing(oldlady, indy);
  621.     Sleep(2.2);
  622.     
  623.     # Start Indy toward Holy Woman...
  624.     AISetMoveSpeed(indy, 1.0);
  625.     AISetLookThing(indy, oldlady);
  626.     AISetMoveThing(indy, in_mk3, 0);
  627.     
  628.     # Holy Woman:  "Hello, young man.  You rang?"
  629.     ol_keyTrack1 = PlayKey(oldlady, ol_stand2honcane, 2, 0x10, 0);
  630.     PlayKey(oldlady, ol_wavecane2, 4, 0x12, 0);
  631.     Sleep(0.5);
  632.     curSound = PlaySoundLocal(ol_rang, 1.0, 0.0, 0x0, 0);
  633.     StopThing(oldlady); # stop that damn churning
  634.     
  635.     # Pan to frame both actors...
  636.     WaitForSound(curSound);
  637.     AIWaitForStop(indy);
  638.     Sleep(0.01);
  639.     AISetLookThing(indy, oldlady); # make him look down at her
  640.     AISetLookThing(oldlady, indy); # and she looks up
  641.     
  642.     # Indy: "That's right, I did."
  643.     curSound = PlaySoundLocal(in_thatsright, 1.0, 0.0, 0x0, 0);
  644.     PlayKey(indy, in_ltarmup, 4, 0x12, 0);
  645.     WaitForSound(curSound);
  646.  
  647.     # Holy Woman: "And you want my help."
  648.     curSound = PlaySoundLocal(ol_wanthelp, 1.0, 0.0, 0x0, 0);
  649.     WaitForSound(curSound);
  650.  
  651.     # Cut to Indy over Holy Woman's shoulder...
  652.     Sleep(0.01);
  653.     SetCameraFocus(2, cam_4);
  654.     SetCameraSecondaryFocus(2, c_t5);
  655.     SetCameraFOV(37, 0, 0.0);
  656.     
  657.     # Indy: "Do I...I'm...lost."
  658.     curSound = PlaySoundLocal(in_lost, 1.0, 0.0, 0x0, 0);
  659.     Sleep(0.5);
  660.     PlayKey(indy, in_botharmsup, 4, 0x12, 0);
  661.     WaitForSound(curSound);
  662.     
  663.     # Cut to reverse on Holy Woman over Indy's shoulder...
  664.     SetCameraLookInterp(2, 0);
  665.     Sleep(0.01);
  666.     SetCameraFocus(2, cam_5);
  667.     SetCameraSecondaryFocus(2, c_t6);
  668.     SetCameraFOV(29, 0, 0.0);
  669.     
  670.     # Holy Woman: "But it is you who must help me...spinning idol...legacy..."
  671.     curSound = PlaySoundLocal(ol_youhelpme, 1.0, 0.0, 0x0, 0);
  672.     
  673.     # Long slow push in...
  674.     MoveToFrame(c_t6, 1, 0.01);
  675.     SetCameraFOV(22, 1, 15.0);
  676.     PlayKey(oldlady, ol_ltwave, 4, 0x12, 0);    
  677.     Sleep(7.5);
  678.     PlayKey(oldlady, ol_ltwave, 4, 0x12, 0);    
  679.     Sleep(5.5);
  680.     PlayKey(oldlady, ol_wavecane2, 4, 0x12, 1);
  681.     WaitForSound(curSound);
  682.     Sleep(0.3); # take a beat
  683.  
  684.     # Cut to Indy again...
  685.     SetCameraLookInterp(2, 0);
  686.     Sleep(0.01);
  687.     SetCameraFocus(2, cam_4);
  688.     SetCameraSecondaryFocus(2, c_t5);
  689.     SetCameraFOV(37, 0, 0.0);
  690.     
  691.     # Indy: "Show me the way."
  692.     curSound = PlaySoundLocal(in_showmeway, 1.0, 0.0, 0x0, 0);
  693.     PlayKey(indy, in_rtarmup, 4, 0x12, 0);    
  694.     WaitForSound(curSound);
  695.     
  696.     # Holy Woman turns and walks away from Indy...
  697.     StopKey(oldlady, ol_keyTrack1, 0.0);
  698.     SetThingMaxRotVel(oldlady, 35.0);
  699.     AISetLookThing(oldlady, ol_mk1);
  700.     Sleep(0.2);
  701.  
  702.     # Holy Woman: "I am too old and infirm...golden treasure."
  703.     curSound = PlaySoundLocal(ol_goldtreasure, 1.0, 0.0, 0x0, 0);
  704.  
  705.     # Dolly back to keep her framed...
  706.     AISetMoveSpeed(oldlady, 0.7);
  707.     AISetMoveThing(oldlady, ol_mk1, 0);
  708.     SetCameraLookInterp(2, 1);
  709.     SetCameraPosInterp(2, 1);
  710.     SetCameraInterpSpeed(2, 4.1);
  711.     Sleep(0.01);
  712.     SetCameraFocus(2, cam_6);
  713.     SetCameraSecondaryFocus(2, c_t7);
  714.     SetCameraFOV(45, 1, 0.8);
  715.     headLookThing = oldlady;
  716.     SetPulse(indyTrackRate);
  717.     AIWaitForStop(oldlady);
  718.     Sleep(6.5);
  719.     
  720.     # Holy Woman turns back toward Indy...
  721.     AISetLookThing(oldlady, indy);
  722.     Sleep(0.5);
  723.     ol_keyTrack1 = PlayKey(oldlady, ol_stand2honcane, 2, 0x10, 0);
  724.     PlayKey(oldlady, ol_pointcane, 4, 0x12, 0);
  725.     
  726.     # Indy walks up to her...
  727.     AISetLookThing(indy, oldlady);
  728.     AISetMoveThing(indy, in_mk4, 0);
  729.     SetCameraLookInterp(2, 0);
  730.     Sleep(0.01);
  731.     MoveToFrame(c_t7, 1, 0.14); # tilt up as Indy approaches
  732.     Sleep(0.01);
  733.     AIWaitForStop(indy);
  734.     AISetLookThing(indy, oldlady);
  735.     SetPulse(0);
  736.     
  737.     # Indy: "Okay...golden treasure..."
  738.     WaitForSound(curSound);
  739.     curSound = PlaySoundLocal(in_whereisit, 1.0, 0.0, 0x0, 0);
  740.     Sleep(1.5);
  741.     PlayKey(indy, in_ltarmup, 4, 0x12, 0);
  742.     WaitForSound(curSound);
  743.  
  744.     # Cut to single shot of Holy Woman...
  745.     SetCameraPosInterp(2, 0);
  746.     Sleep(0.01);
  747.     SetCameraFocus(2, cam_7);
  748.     SetCameraSecondaryFocus(2, c_t8);
  749.     SetCameraFOV(35, 0, 0.0);
  750.     SetThingFlags(indy, 0x10); # invisible
  751.  
  752.     # Holy Woman: "Why, in the treasury, of course!"
  753.     curSound = PlaySoundLocal(ol_treasury, 1.0, 0.0, 0x0, 0);
  754.     Sleep(0.5);
  755.     PlayKey(oldlady, ol_wavecane2, 4, 0x12, 1);
  756.     StopKey(oldlady, ol_keyTrack1, 0.0);
  757.     ol_keyTrack1 = PlayKey(oldlady, ol_standwkey, 2, 0x10, 0);
  758.     ol_swapCase = 1; # swap oldlady key hand
  759.     PlayKey(oldlady, ol_showkey, 4, 0x12, 0);
  760.     WaitForSound(curSound);
  761.     Sleep(0.3);
  762.  
  763.     # Cut to full side shot of both actors...
  764.     SetCameraFocus(2, cam_8);
  765.     SetCameraSecondaryFocus(2, c_t9);
  766.     SetCameraFOV(70, 0, 0.0);
  767.     ClearThingFlags(indy, 0x10); # visible again
  768.  
  769.     # Holy Woman: "Take this, it may help you."
  770.     curSound = PlaySoundLocal(ol_takekey, 1.0, 0.0, 0x0, 0);
  771.  
  772.     # She gives Indy the key...
  773.     Sleep(1.5);
  774.     StopKey(oldlady, ol_keyTrack1, 0.0);
  775.     ol_keyTrack1 = PlayKey(oldlady, ol_basicstand, 2, 0x10, 0);
  776.     PlayKey(oldlady, ol_givekey, 4, 0x12, 0);
  777.     in_swapCase = 1; # swap indy key hand
  778.     PlayKey(indy, in_takekey, 4, 0x12, 1);
  779.     StopKey(oldlady, ol_keyTrack1, 0.5);
  780.     WaitForSound(curSound);
  781.  
  782.     # Key zips into inventory...
  783.     ChangeInv(player, sealkey, 1.0); # add key to inventory bin
  784.     SetInvAvailable(player, sealkey, 1); # make it available for use
  785.     JonesInvItemChanged(sealkey); # show acquisition
  786.     
  787.     # Prep Holy Woman for follow-up chat that might occur before Indy leaves area...
  788.     SetThingCollideSize(oldlady, 0.06); # set correct talk distance
  789.     SetThingMass(oldlady, 0); # 0 = infinite...don't let player push her around!
  790.     AIClearMode(oldlady, 0x2000); # start her watch-indy AI
  791.  
  792.     return;
  793.  
  794. # ...................................................................
  795.  
  796. noring:
  797.  
  798.     # Reposition Indy...
  799.     TeleportThing(indy, in_mk6);
  800.     Sleep(0.01);
  801.     AISetLookThing(indy, in_mk7);
  802.     
  803.     # Cut inside tower...
  804.     SetCameraLookInterp(2, 0); # no pan & tilt
  805.     SetCameraFocus(2, cam_3);
  806.     SetCameraSecondaryFocus(2, bellringer);
  807.     SetCameraFOV(80, 0, 0.0);
  808.     Sleep(0.01);
  809.  
  810.     # Finish ringer move...
  811.     AIWaitForStop(bellringer);
  812.     StopKey(bellringer, br_keyTrack1, 0.0);
  813.     Sleep(0.3);
  814.     DetachThing(c_t2_br);
  815.     DestroyThing(c_t2_br);
  816.     
  817.     # Now it retreats...
  818.     SetCameraLookInterp(2, 1); # allow pan & tilt
  819.     SetCameraInterpSpeed(2, 5.5);
  820.     AISetMoveThing(bellringer, br_mk1, 0);
  821.     br_keyTrack1 = PlayKey(bellringer, br_back, 4, 0x10, 0);
  822.     Sleep(0.01);
  823.     SetCameraSecondaryFocus(2, c_t1);
  824.     SetCameraFOV(28, 1, 5.5);
  825.     
  826.     # Pose Indy...
  827.     Sleep(2.0);
  828.     SetPulse(0); # stop his head moving around
  829.     Sleep(1.5);
  830.     
  831.     # Reset bellringer...
  832.     StopKey(bellringer, br_keyTrack1, 0.0);
  833.     StopThing(bellringer);
  834.     TeleportThing(bellringer, br_mk1);
  835.     Sleep(0.1); # this is a magic sleep that cures target placement on re-tries!
  836.     SetThingFlags(bellringer, 0x80000); # hide
  837.     ringerState = 0;
  838.     
  839.     # Indy comments...
  840.  
  841.     if (noRingComment == 0 && bellRangAlready == 0)
  842.     {
  843.         noRingComment = 1;
  844.         in_keyTrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  845.         PlayKey(indy, in_crossArms, 4, 0x12, 0);
  846.         PlaySoundLocal(in_notgoodenough, 1.0, 0.0, 0x0, 1);
  847.     }
  848.     else
  849.     {
  850.         in_keyTrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  851.         PlayKey(indy, in_crossArms, 4, 0x12, 1);
  852.         PlaySoundLocal(in_hmm, 1.0, 0.0, 0x0, 1);
  853.     }
  854.  
  855.     StopKey(indy, in_keyTrack1, 1.0);
  856.     Sleep(0.8);
  857.  
  858.     SetCameraLookInterp(2, 0); # no pan & tilt
  859.     
  860.     return;
  861.  
  862. # ...................................................................
  863.  
  864. noroll:
  865.  
  866.     ringerState = 0;
  867.     Sleep(1.0);
  868.     AISetLookThing(indy, cam_3);
  869.     Sleep(1.5);
  870.     StopThing(indy);
  871.     in_keyTrack1 = PlayKey(indy, in_handsOnHips, 2, 0x10, 0);
  872.     PlayKey(indy, in_handsToHips, 4, 0x12, 1);
  873.  
  874.     if (noRollComment == 0)
  875.     {
  876.         noRollComment = 1;
  877.         PlayKey(indy, in_PushHat, 4, 0x12, 0);
  878.         PlaySoundLocal(in_nowork, 1.0, 0.0, 0x0, 1);
  879.     }
  880.     else
  881.     {
  882.         PlaySoundLocal(in_hmm, 1.0, 0.0, 0x0, 1);
  883.     }
  884.  
  885.     Sleep(0.5);
  886.     StopKey(indy, in_keyTrack1, 0.5);
  887.     Sleep(0.5);
  888.  
  889.     return;
  890.  
  891. # ...................................................................
  892.  
  893. backtoplay:
  894.  
  895.     # restore player control...
  896.     leverState = 0;
  897.     SetThingMaxRotVel(indy, in_rotRate);
  898.     CopyOrientAndPos(indy, player); # move player to actor's spot
  899.     SetThingFlags(indy, 0x80000); # hide actor    
  900.     camPos = GetThingPOS(camPosThing); 
  901.     SetCameraPosition(1, camPos); # prep to swing back to follow-cam
  902.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  903.     SetCameraPosInterp(2, 0); # kill dolly mode
  904.     ClearThingFlags(player, 0x80000); # player visible
  905.     ClearActorFlags(player, 0x200000); # player in control
  906.     SetCurrentCamera(curCam);
  907.     ResetCameraFOV(0, 0.0);
  908.     
  909.     EndCutscene();
  910.         
  911.     return;
  912.  
  913. # ...................................................................
  914.  
  915. morechat:
  916.  
  917.     # Prep...
  918.     StartCutscene(1);
  919.     SetActorFlags(player, 0x200000); # remove player controls
  920.     ClearThingFlags(indy, 0x80000); # summon actor
  921.     SetThingFlags(indy, 0x10); # make actor present but invisible
  922.     TeleportThing(indy, player); # plant actor indy at player location
  923.     Sleep(0.01);
  924.     
  925.     # Align Indy and Holy Woman...
  926.     if (sender == oldlady)
  927.     {
  928.         AISetMode(oldlady, 0x2000); # stop indy-watch AI
  929.         Sleep(0.01);
  930.         headLookThing = oldlady;
  931.         AISetLookThing(indy, oldlady);
  932.         AISetLookThing(oldlady, indy);
  933.     }
  934.     else
  935.     {
  936.         AISetMode(younglady, 0x2000); # stop indy-watch AI
  937.         Sleep(0.01);
  938.         SetThingMaxRotVel(younglady, 25.0);
  939.         headLookThing = younglady;
  940.         AISetLookThing(indy, younglady);
  941.         AISetLookThing(younglady, indy);
  942.     }
  943.     Sleep(0.5); # allow time to line up
  944.  
  945.     # Align follow-cam by aligning player to our actor...
  946.     CopyOrientAndPos(indy, player); # weird but effective
  947.     
  948.     # Now show actor and hide player...
  949.     CopyPlayerHolsters(player, indy);
  950.     ClearThingFlags(indy, 0x10); # show him
  951.     SetThingFlags(player, 0x80000); # hide player
  952.     
  953.     Sleep(0.01);
  954.     
  955.     SetPulse(indyTrackRate);
  956.  
  957.     # Slew to side shot of indy and Holy Woman...
  958.     # TO DO: fix cam look interp offset bug...
  959.     if (sender == oldlady)
  960.     {
  961.         SetExtCamLookOffset('0.0 0.04 0.009'); # oldlady is short
  962.     }
  963.     else
  964.     {
  965.         SetExtCamLookOffset('0.0 0.04 0.011'); # younglady is tall
  966.     }
  967.     SetExtCamOffset('0.18 0.02 0.055'); # interp cam out to right
  968.     
  969.     Sleep(0.5);
  970.     
  971.     SetPulse(0);
  972.     
  973.     if (cutSceneState == 3)
  974.     {
  975.         # If the big bronze doors are already open...
  976.         call iceprompt;
  977.         AIClearMode(younglady, 0x2000); # resume indy-watch AI
  978.     }
  979.     else
  980.     {
  981.         if (GetInv(player, plantbud) == 1)
  982.         {
  983.             # If Indy has the budding plant, finish the scene right now...
  984.             call givetreasure;
  985.             camPos = GetThingPOS(cam_9); 
  986.             SetCameraPosition(1, camPos); # prep to swing back to follow-cam
  987.             AIClearMode(younglady, 0x2000); # start indy-watch AI
  988.         }
  989.         else
  990.         {        
  991.             if (GetInv(player, plantleaf) == 1)
  992.             {
  993.                 # NOTE:  whoops, there are no lines for being partly-done...
  994.                 call gotbulb;
  995.                 AIClearMode(oldlady, 0x2000); # resume indy-watch AI
  996.  
  997.             }
  998.             else
  999.             {
  1000.                 if (GetInv(player, plantbulb) == 1)
  1001.                 {
  1002.                     call gotbulb;
  1003.                     AIClearMode(oldlady, 0x2000); # resume indy-watch AI
  1004.                 }
  1005.                 else
  1006.                 {
  1007.                     call noprogress;
  1008.                     AIClearMode(oldlady, 0x2000); # resume indy-watch AI
  1009.                 }
  1010.             }
  1011.         }
  1012.     }
  1013.  
  1014.     # Restore player control...
  1015.     CopyOrientAndPos(indy, player); # pop player to actor spot
  1016.     SetThingFlags(indy, 0x80000); # hide actor    
  1017.     ClearThingFlags(player, 0x80000); # player visible
  1018.     ClearActorFlags(player, 0x200000); # player in control
  1019.     SetThingMaxRotVel(indy, in_rotRate);
  1020.     SetCurrentCamera(curCam);
  1021.     RestoreExtCam();
  1022.     ResetCameraFOV(0, 0.0);
  1023.     EndCutscene();
  1024.         
  1025.     return;
  1026.     
  1027. # ...................................................................
  1028.  
  1029. noprogress:
  1030.         
  1031.     # Holy Woman: "Where's the golden treasure?"
  1032.     if (cutSceneState == 0)
  1033.     {
  1034.         # cutSceneState = 1; # only read this line once
  1035.         curSound = PlaySoundLocal(ol_hello2, 1.0, 0.0, 0x0, 0);
  1036.     }
  1037.     else
  1038.     {
  1039.         curSound = PlaySoundLocal(ol_hello3, 1.0, 0.0, 0x0, 0);
  1040.     }
  1041.     Sleep(0.5);
  1042.     WaitForSound(curSound);
  1043.     
  1044.     # Indy: "I haven't found it yet."
  1045.     curSound = PlaySoundLocal(in_notfoundyet, 1.0, 0.0, 0x0, 0);
  1046.     in_keyTrack1 = PlayKey(indy, in_handsOnHips, 2, 0x10, 0);
  1047.     PlayKey(indy, in_handsToHips, 4, 0x12, 1);
  1048.     WaitForSound(curSound);
  1049.  
  1050.     if (cutSceneState == 0)
  1051.     {
  1052.         # Holy Woman: "Examine the treasury!"
  1053.         curSound = PlaySoundLocal(ol_looktreasury, 1.0, 0.0, 0x0, 0);
  1054.     }
  1055.     else
  1056.     {
  1057.         # Holy Woman: "something else more generic..."
  1058.         curSound = PlaySoundLocal(ol_looktreasury, 1.0, 0.0, 0x0, 0);
  1059.     }
  1060.  
  1061.     # TO DO: Get ol animation that returns to stand1, not 2
  1062.     PlayKey(oldlady, ol_pointcane, 4, 0x12, 0);
  1063.     
  1064.     WaitForSound(curSound);
  1065.     cutSceneState = 1;
  1066.     
  1067.     StopKey(indy, in_keyTrack1, 0.5);
  1068.     Sleep(0.5);
  1069.  
  1070.     return;
  1071.  
  1072. # ...................................................................
  1073.  
  1074. gotbulb:
  1075.         
  1076.     # Holy Woman: "Peace, young man.  Where's the treasure?"
  1077.     curSound = PlaySoundLocal(ol_hello3, 1.0, 0.0, 0x0, 0);
  1078.     Sleep(0.5);
  1079.     WaitForSound(curSound);
  1080.     
  1081.     # Indy: "All I've found is a plant bulb."
  1082.     curSound = PlaySoundLocal(in_foundbulbA, 1.0, 0.0, 0x0, 0);    
  1083.     PlayKey(indy, in_botharmsup, 4, 0x12, 1);
  1084.     WaitForSound(curSound);
  1085.     
  1086.     if (cutSceneState < 2)
  1087.     {
  1088.         # Indy: "Not much of a treasure..."
  1089.         curSound = PlaySoundLocal(in_foundbulbb, 1.0, 0.0, 0x0, 0);
  1090.         PlayKey(indy, in_ltarmup, 4, 0x12, 1);
  1091.         WaitForSound(curSound);    
  1092.     }
  1093.         
  1094.     if (cutSceneState < 2)
  1095.     {
  1096.         # Holy Woman: "Yet it must become one..."
  1097.         curSound = PlaySoundLocal(ol_mustbecome, 1.0, 0.0, 0x0, 0);
  1098.         PlayKey(oldlady, ol_pointcane, 4, 0x12, 0);
  1099.     }
  1100.     else
  1101.     {
  1102.         # Holy Woman: "snort!"
  1103.         curSound = PlaySoundLocal(ol_snort, 1.0, 0.0, 0x0, 0);
  1104.         PlayKey(oldlady, ol_ltwave, 4, 0x12, 0);
  1105.     }
  1106.     WaitForSound(curSound);
  1107.     
  1108.     cutSceneState = 2;
  1109.     
  1110.     Sleep(0.5);
  1111.  
  1112.     return;
  1113.     
  1114. # ...................................................................
  1115.  
  1116. givetreasure:
  1117.  
  1118.     # Prep camera...
  1119.     SetCameraLookInterp(2, 0);
  1120.     
  1121.     # Holy Woman: "You again.  Do you have the treasure?"
  1122.     curSound = PlaySoundLocal(ol_gottreasure, 1.0, 0.0, 0x0, 0);
  1123.  
  1124.     # gestures
  1125.  
  1126.     WaitForSound(curSound);
  1127.     
  1128.     # Indy: "Here's the best I could do..."
  1129.     in_swapCase = 2; # indy swapping plant
  1130.     curSound = PlaySoundLocal(in_bestdo, 1.0, 0.0, 0x0, 0);
  1131.     # in_keyTrack1 = 
  1132.     PlayKey(indy, in_plantready, 2, 0x12, 1);
  1133.     # Sleep(1.0);
  1134.     
  1135.     # Indy gives her the budding plant...
  1136.     # StopKey(indy, in_keyTrack1, 0.0);
  1137.     PlayKey(indy, in_giveplant, 4, 0x12, 0);
  1138.     ol_swapCase = 2; # oldlady swapping plant
  1139.     ol_keyTrack1 = PlayKey(oldlady, ol_stand2honcane, 2, 0x0, 0);
  1140.     PlayKey(oldlady, ol_takeplantA, 4, 0x12, 1);
  1141.     StopKey(oldlady, ol_keyTrack1, 0.0);
  1142.     in_swapCase = 0; # indy swaps no more
  1143.     Sleep(0.01);
  1144.     
  1145.     # Cut to close-up of Holy Woman...
  1146.     SetCameraFocus(2, cam_9);
  1147.     SetCameraSecondaryFocus(2, c_t10);
  1148.     SetCurrentCamera(2);
  1149.     SetCameraFOV(35, 0, 0.0);
  1150.     CopyOrient(ol_plantspot, oldlady); # snap her to proper orientation
  1151.     SetThingFlags(indy, 0x10); # invisible
  1152.     
  1153.     # She takes the plant...
  1154.     PlayKey(oldlady, ol_takeplantB, 4, 0x12, 1);
  1155.     
  1156.     # Holy Woman: "Not yet."
  1157.     ol_keyTrack1 = PlayKey(oldlady, ol_lookatbud, 2, 0x14, 0);
  1158.     WaitForSound(curSound);
  1159.     curSound = PlaySoundLocal(ol_notyet, 1.0, 0.0, 0x0, 0);
  1160.     WaitForSound(curSound);
  1161.     
  1162.     # Lose plant from Indy's inventory...
  1163.     ChangeInv(player, plantbud, -1.0);
  1164.     
  1165.     # Substitute young woman for old...
  1166.     StopKey(oldlady, ol_keyTrack1, 0.0);
  1167.     CopyOrientAndPos(oldlady, younglady); # young woman into position
  1168.     SetThingFlags(oldlady, 0x80000); # hide old    
  1169.     ClearThingFlags(younglady, 0x80000); # reveal young
  1170.     ol_swapCase = 0; # oldlady swaps no more
  1171.     DestroyThing(oldlady);
  1172.     AISetMode(younglady, 0x2000); # turn off her AI
  1173.     yl_keyTrack1 = PlayKey(younglady, yl_bentover, 2, 0x10, 0);
  1174.     
  1175.     # Cut to close-up of the plant as it bursts into bloom...
  1176.     SetCameraFocus(2, cam_10);
  1177.     SetCameraSecondaryFocus(2, c_t11);
  1178.     SetCameraFOV(20, 0, 0.0);
  1179.     ClearThingFlags(plant, 0x80000); # now you see it
  1180.     plt_keyTrack1 = PlayKey(plant, plant_wait, 2, 0x10, 0); # hold on bud
  1181.     Sleep(0.1);
  1182.     PlayKey(plant, plant_bloom, 4, 0x12, 0);
  1183.  
  1184.     # TO DO: fairy dust particles
  1185.  
  1186.     Sleep(3.7);
  1187.  
  1188.     # Camera tilts up and widens view to reveal young Holy Woman...
  1189.     StopKey(plant, plt_keyTrack1, 0.0);
  1190.     SetCameraFOV(33, 1, 1.5);
  1191.     MoveToFrame(c_t11, 1, 0.47); # tilt up
  1192.     Sleep(0.5);
  1193.     StopKey(younglady, yl_keyTrack1, 0.0);
  1194.     yl_keyTrack1 = PlayKey(younglady, yl_upright, 2, 0x10, 0);
  1195.     PlayKey(younglady, yl_transform, 4, 0x12, 0);
  1196.  
  1197.     # TO DO:  magical visual effect here...
  1198.  
  1199.     Sleep(2.0);
  1200.  
  1201.     # Cut to Indy reacting...
  1202.     CopyOrientAndPos(in_mk5, indy); # move indy into position
  1203.     SetCameraFocus(2, cam_11);
  1204.     SetCameraSecondaryFocus(2, c_t12);
  1205.     SetCameraFOV(30, 0, 0.0);
  1206.     SetThingFlags(plant, 0x80000); # hide
  1207.     SetThingFlags(younglady, 0x10); # hide
  1208.     ClearThingFlags(indy, 0x10); # show him
  1209.     SwapMeshes(mod_yl, 21, mod_yl_hand_bloom, 0); # younglady swap plant in offscreen
  1210.     SwapMeshes(mod_yl, 17, mod_yl_hand_cane, 0); # younglady swap cane in offscreen
  1211.     PlayKey(indy, in_wow, 4, 0x12, 1);
  1212.  
  1213.     # Cut back to Holy Woman holding plant...
  1214.     SetCameraFocus(2, cam_12);
  1215.     SetCameraSecondaryFocus(2, c_t13);
  1216.     SetCameraFOV(43, 0, 0.0); # was 40
  1217.     ClearThingFlags(younglady, 0x10); # she's back
  1218.     SetThingFlags(indy, 0x10); # hide him
  1219.     StopKey(younglady, yl_keyTrack1, 0.0);
  1220.     yl_keyTrack1 = PlayKey(younglady, yl_standwf, 2, 0x10, 0);
  1221.     Sleep(0.01);
  1222.     
  1223.     # Holy Woman throws cane...
  1224.     ClearThingFlags(flyingcane, 0x80000); # summon cane
  1225.     SetThingFlags(flyingcane, 0x10); # make it invisible
  1226.     yl_swapCase = 1; # younglady swaps cane
  1227.     PlayKey(younglady, yl_losecane, 4, 0x12, 0);  
  1228.     can_keyTrack1 = PlayKey(flyingcane, cane_fly, 4, 0x14, 0); # synch animations
  1229.     Sleep(0.6);
  1230.     ClearThingFlags(flyingcane, 0x10); # now see cane
  1231.     yl_swapCase = 0; # swap cane once only
  1232.     
  1233.     # Holy Woman: "Ahhh!  Your gift is great!  Now..."
  1234.     WaitForSound(curSound); # long since over...this is a formality
  1235.     curSound = PlaySoundLocal(yl_greatgift, 1.0, 0.0, 0x0, 0);
  1236.     
  1237.     # Cane disappears...
  1238.     Sleep(0.5);
  1239.     StopKey(flyingcane, cane_keyTrack1, 0.0);
  1240.     SetThingFlags(flyingcane, 0x80000); # cane is gone
  1241.     WaitForSound(curSound);
  1242.  
  1243.     # Prep Holy Woman to unlock & open doors...
  1244.     AttachThingToThing(c_t13, younglady);
  1245.     SetThingMaxRotVel(younglady, 25.0);
  1246.     AISetMoveSpeed(younglady, 1.2);
  1247.     SetCollideType(barlock, 0);
  1248.     SetCollideType(leftdoor, 0);
  1249.     SetCollideType(rightdoor, 0);
  1250.     
  1251.     # Holy Woman walks to flower stand...
  1252.     SetArmedMode(younglady, 1); # causes walking with plant
  1253.     Sleep(0.01);
  1254.     StopKey(younglady, yl_keyTrack1, 0.0);
  1255.     AISetLookThing(younglady, yl_mk1);
  1256.     AISetMoveThing(younglady, yl_mk1, 0);
  1257.     MoveToFrame(c_t13, 1, 0.12);
  1258.     AIWaitForStop(younglady);
  1259.     
  1260.     # Holy Woman deposits flower on stand...
  1261.     yl_swapCase = 2; # younglady swaps plant
  1262.     PlayKey(younglady, yl_putflower, 4, 0x12, 1);
  1263.     ClearThingFlags(static_flower, 0x80000);
  1264.     SetArmedMode(younglady, 0); # cease walking with plant
  1265.     yl_swapCase = 0; # younglady swaps no more
  1266.     
  1267.     # Holy Woman walks to bar...
  1268.     SetCameraInterpSpeed(2, 3.5);
  1269.     SetCameraLookInterp(2, 1);
  1270.     Sleep(0.01);
  1271.     SetCameraSecondaryFocus(2, c_t14);
  1272.     SetCameraFOV(90, 1, 3.5);
  1273.     AISetLookThing(younglady, yl_mk2);
  1274.     AISetMoveThing(younglady, yl_mk2, 0);
  1275.     AIWaitForStop(younglady);
  1276.     Sleep(0.01);
  1277.  
  1278.     # Holy Woman heaves bar aside...
  1279.     CopyOrient(yl_mk2, younglady); # snap her to proper orientation
  1280.     bar_keyTrack1 = PlayKey(barlock, bar_flip, 4, 0x14, 0); # hold forever!
  1281.     yl_keyTrack1 = PlayKey(younglady, yl_throwbar, 4, 0x12, 0);
  1282.     Sleep(2.0);
  1283.     StopKey(younglady, yl_keyTrack1, 0.0);
  1284.  
  1285.     # Holy Woman walks to middle of the doors...
  1286.     AISetLookThing(younglady, yl_mk3);
  1287.     AISetMoveThing(younglady, yl_mk3, 0);
  1288.     Sleep(1.0);
  1289.     AISetLookThing(younglady, yl_mk5);
  1290.     AIWaitForStop(younglady);
  1291.     
  1292.     # Holy Woman slams open the doors...
  1293.     CopyOrient(yl_mk3, younglady); # snap her to face doors
  1294.     Sleep(0.01);
  1295.     ldr_keyTrack1 = PlayKey(leftdoor, ldr_open, 4, 0x14, 0); # hold forever!
  1296.     rdr_keyTrack1 = PlayKey(rightdoor, rdr_open, 4, 0x14, 0); # hold forever!
  1297.     PlayKey(younglady, yl_opendoors, 4, 0x12, 1);
  1298.     
  1299.     # ...and stands aside...
  1300.     CopyOrientAndPos(yl_mk4, younglady); # move her to final mark
  1301.     AISetLookThing(younglady, indy); # focus on Indy
  1302.     SetCameraLookInterp(2, 0);
  1303.     Sleep(0.01);
  1304.     SetCameraFocus(2, cam_13);
  1305.     SetCameraSecondaryFocus(2, c_t15);
  1306.     SetCameraFOV(63, 0, 0.0);
  1307.     # AISetLookThing(younglady, indy);
  1308.     
  1309.     # swap the animated lock and doors for statics...
  1310.     DestroyThing(barlock);
  1311.     ClearThingFlags(barup, 0x80000);
  1312.     DestroyThing(leftdoor);
  1313.     ClearThingFlags(ldooropen, 0x80000);
  1314.     DestroyThing(rightdoor);
  1315.     ClearThingFlags(rdooropen, 0x80000);    
  1316.     
  1317.     # Holy Woman: "Here is the way to the Babylonian curse..."
  1318.     curSound = PlaySoundLocal(yl_waytocurse, 1.0, 0.0, 0x0, 0);
  1319.     PlayKey(younglady, yl_armspointway, 4, 0x12, 1);
  1320.     Sleep(1.5);
  1321.     PlayKey(younglady, yl_armsup, 4, 0x12, 1);    
  1322.     WaitForSound(curSound);
  1323.  
  1324.     # Clean up and prep for residual chat...
  1325.     ClearThingFlags(indy, 0x10); # see him again
  1326.     SetThingCollideSize(younglady, 0.06); # set correct talk distance
  1327.     SetThingMass(younglady, 0); # make her immoveable
  1328.     AIClearMode(younglady, 0x2000); # start her watch-indy AI
  1329.     
  1330.     cutSceneState = 3; # doors are OPEN
  1331.  
  1332.     return;
  1333.  
  1334. # ...................................................................
  1335.  
  1336. iceprompt:
  1337.         
  1338.     # Holy Woman: "Beware the ice..."
  1339.     curSound = PlaySoundLocal(yl_bewareice, 1.0, 0.0, 0x0, 0);
  1340.     PlayKey(younglady, yl_lthandup, 4, 0x12, 0);
  1341.     WaitForSound(curSound);
  1342.     Sleep(0.2);
  1343.  
  1344.     return;
  1345.     
  1346. # ...................................................................
  1347.  
  1348. doorbarred:
  1349.  
  1350.     StartCutScene(0);
  1351.     
  1352.     # Prep indy...
  1353.     CopyOrientAndPos(player, indy); # move actor indy into position
  1354.     CopyOrient(yl_mk5, indy); # snap him to proper orientation
  1355.  
  1356.     # Disable player...
  1357.     StopThing(player); # right now
  1358.     PlayMode(player, 1, 0); # get him into a nice stand
  1359.     DeselectWeapon(player); # stow any weapon or lighter
  1360.     CopyPlayerHolsters(player, indy); # make sure our actor has matching props
  1361.     Sleep(0.5); # give him some time to do his stuff
  1362.     
  1363.     # Switch actor indy for player...
  1364.     CopyOrient(indy, player); # orient the player
  1365.     SetThingFlags(player, 0x80000); # hide him
  1366.     SetActorFlags(player, 0x200000); # paralyze him
  1367.     ClearThingFlags(indy, 0x80000); # reveal our actor
  1368.     Sleep(0.01);
  1369.     
  1370.     # TO DO: flatten the collision bubble on the bar, so interps can't fail...
  1371.     
  1372.     SetExtCamLookOffset('0.0 0.05 0.008'); # look toward door
  1373.     SetExtCamOffset('-0.25 0.0 0.085'); # interp cam out to left
  1374.  
  1375.     If (doorchat == 0)
  1376.     {
  1377.         doorchat = 1; # say this line just once
  1378.         curSound = PlaySoundLocal(in_doorlocked, 1.0, 0.0, 0x0, 0);
  1379.     }
  1380.     else
  1381.     {    
  1382.         curSound = PlaySoundLocal(in_notopen, 1.0, 0.0, 0x0, 0);
  1383.     }
  1384.     
  1385.     in_keyTrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  1386.     PlayKey(indy, in_crossArms, 4, 0x12, 1);
  1387.     WaitForSound(curSound);
  1388.     StopKey(indy, in_keyTrack1, 0.5);    
  1389.     Sleep(0.5);
  1390.  
  1391.     RestoreExtCam();
  1392.     SetThingFlags(indy, 0x80000); # hide actor
  1393.     ClearThingFlags(player, 0x80000); # show player again
  1394.     ClearActorFlags(player, 0x200000); # remove player controls
  1395.     EndCutScene();
  1396.     
  1397.     return;
  1398.  
  1399. # ...................................................................
  1400.  
  1401. callback:
  1402.  
  1403.     swapper = GetSenderRef();
  1404.     
  1405.     if (swapper == indy)
  1406.     {
  1407.         if (in_swapCase == 1)
  1408.         {
  1409.             # Swap key...
  1410.             SwapMeshes(mod_in, 15, mod_in_hand_key, 0);
  1411.         }
  1412.  
  1413.         if (in_swapCase == 2)
  1414.         {
  1415.             # Swap plant...
  1416.             SwapMeshes(mod_in, 15, mod_in_hand_bud, 0);
  1417.         }
  1418.     }
  1419.  
  1420.     if (swapper == oldlady)
  1421.     {
  1422.         if (ol_swapCase == 1)
  1423.         {
  1424.             # Swap key...
  1425.             SwapMeshes(mod_ol, 22, mod_ol_hand_key, 0);
  1426.         }
  1427.  
  1428.         if (ol_swapCase == 2)
  1429.         {
  1430.             # Swap plant...
  1431.             SwapMeshes(mod_ol, 22, mod_ol_hand_bud, 0);
  1432.         }
  1433.     }
  1434.  
  1435.     if (swapper == younglady)
  1436.     {
  1437.         if (yl_swapCase == 1)
  1438.         {
  1439.             # Swap cane...
  1440.             SwapMeshes(mod_yl, 17, mod_yl_hand_cane, 0);
  1441.         }
  1442.  
  1443.         if (yl_swapCase == 2)
  1444.         {
  1445.             # Swap plant...
  1446.             SwapMeshes(mod_yl, 21, mod_yl_hand_bloom, 0);
  1447.         }
  1448.     }
  1449.  
  1450.     return;
  1451.  
  1452. # ...................................................................
  1453.  
  1454. pulse:
  1455.  
  1456.     SetThingHeadLookThing(indy, headLookThing);
  1457.     
  1458.     return;
  1459.     
  1460. # ...................................................................    
  1461.  
  1462. end
  1463.